//创建标签的控制器JS
msqbapp.controller('biaoqianController',function ($scope,msqbService) {
    $scope.userId = 0;
    $scope.classifyId = 0;
    //创建标签的初始化函数
    $scope.biaoqianInit = function () {
        var classifyId =window.location.search.split('=')[1];
        var arr = window.location.search.split('&');
        for (var i = 0;i<arr.length;i++){
            var strarr = arr[i].split('=');
            if(strarr[0]=='?userId'){
                $scope.userId = strarr[1];
            }
            if(strarr[0]=='classifyId'){
                $scope.classifyId = strarr[1];
            }
        }
        //得到标签列表
        msqbService.getTagTypeBeanList($scope.classifyId,$scope.userId).success(function (resp) {
                $scope.tagTypeList = resp;
        });
    };
    //具体标签的点击事件
    $scope.toTopicList=function (tagId) {
        //已读
        if(tagId==5){
            window.open("yidu.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId);
        };
        //了解
        if(tagId==1){
            window.open("liaojie.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&tagFlag="+tagId);
        };
        //掌握
        if(tagId==2){
            window.open("zhangwo.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&tagFlag="+tagId);
        }
        //熟练
        if(tagId==3){
            window.open("shulian.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&tagFlag="+tagId);
        }
        //掌握
        if(tagId==4){
            window.open("jingtong.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&tagFlag="+tagId);
        }
        //收藏
        if(tagId==6){
            window.open("shoucang.html?userId="+$scope.userId+"&classifyId="+$scope.classifyId+"&tagFlag="+tagId);
        }
    }
});